
#ifndef UCDB_DBUNDERLAYREF_H
#define UCDB_DBUNDERALYREF_H
#pragma once

#include "zdbmain.h"
#include "zacstring.h"

#pragma pack (push, 8)

class UcUnderlayLayer;

class ZSOFT_NO_VTABLE UcDbUnderlayReference: public UcDbEntity
{
public:
    UCDB_DECLARE_MEMBERS(UcDbUnderlayReference);
    virtual ~UcDbUnderlayReference() = 0;
    UcGePoint3d       position() const;
    Ucad::ErrorStatus setPosition(const UcGePoint3d& position);
    UcGeScale3d       scaleFactors() const;
    Ucad::ErrorStatus setScaleFactors(const UcGeScale3d& scale);
    double            rotation() const;
    Ucad::ErrorStatus setRotation(double rotation);
    UcGeVector3d      normal() const;
    Ucad::ErrorStatus setNormal(const UcGeVector3d& normal);
    UcGeMatrix3d transform() const;
    Ucad::ErrorStatus setTransform(const UcGeMatrix3d& transform);
    UcDbObjectId      definitionId() const;
    Ucad::ErrorStatus setDefinitionId(UcDbObjectId id);
    const UcGePoint2dArray&  clipBoundary() const;
    Ucad::ErrorStatus        setClipBoundary(const UcGePoint2dArray& clipBoundary);
	bool                     isClipped() const;
    Ucad::ErrorStatus        setIsClipped(bool value);
    ZSoft::UInt8      contrast() const;
    Ucad::ErrorStatus setContrast(ZSoft::UInt8 value);
    ZSoft::UInt8      fade() const;
    Ucad::ErrorStatus setFade(ZSoft::UInt8 value);
    bool              isOn() const;
    Ucad::ErrorStatus setIsOn(bool value);
    bool              isMonochrome() const;
    Ucad::ErrorStatus setIsMonochrome(bool value);
    bool              isAdjustedForBackground() const;
    Ucad::ErrorStatus setIsAdjustedForBackground(bool value);
    virtual bool isFrameVisible() const;
    virtual bool isFramePlottable() const;
    virtual bool isContentSnappable() const;
    ZSoft::UInt32 underlayLayerCount() const;
    Ucad::ErrorStatus getUnderlayLayer(int index, UcUnderlayLayer& layer) const;
    Ucad::ErrorStatus setUnderlayLayer(int index, const UcUnderlayLayer& layer);
    static ZSoft::UInt8 contrastLowerLimit();
    static ZSoft::UInt8 contrastUpperLimit();
    static ZSoft::UInt8 contrastDefault();
    static ZSoft::UInt8 fadeLowerLimit();
    static ZSoft::UInt8 fadeUpperLimit();
    static ZSoft::UInt8 fadeDefault();
	bool isClipInverted() const;
	Ucad::ErrorStatus setClipInverted(bool value);
	Ucad::ErrorStatus generateClipBoundaryFromPline(UcDbObjectId polyId);
};

class UcDbDwfReference: public UcDbUnderlayReference
{
public:
    UCDB_DECLARE_MEMBERS(UcDbDwfReference);
    UcDbDwfReference();
    virtual ~UcDbDwfReference();
    virtual Ucad::ErrorStatus   getClassID(CLSID* pClsid) const;
};

class UcDbDgnReference: public UcDbUnderlayReference
{
public:
    UCDB_DECLARE_MEMBERS(UcDbDgnReference);
    UcDbDgnReference();
    virtual ~UcDbDgnReference();
    virtual Ucad::ErrorStatus   getClassID(CLSID* pClsid) const;
    void setXrefDepth(int depth);
};

class UcDbPdfReference: public UcDbUnderlayReference
{
public:
    UCDB_DECLARE_MEMBERS(UcDbPdfReference);
	UcDbPdfReference();
	virtual ~UcDbPdfReference();

protected:
	virtual Ucad::ErrorStatus   getClassID(CLSID* pClsid) const;

public:
	static ZSoft::UInt8 contrastDefault();
	static ZSoft::UInt8 fadeDefault();
};

#pragma pack (pop)

#endif
